home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / stddefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  6.3 KB  |  210 lines

  1. #ifndef __RWSTDDEFS_H__
  2. #define __RWSTDDEFS_H__
  3. #pragma option push -b -a4 -Vx- -Ve- -w-inl -w-aus -w-sig
  4.  
  5. /***************************************************************************
  6.  *
  7.  * stddefs.h - Common definitions
  8.  *
  9.  * $Id: stddefs.h,v 1.19 1996/09/24 19:18:09 smithey Exp $
  10.  *
  11.  ***************************************************************************
  12.  *
  13.  * (c) Copyright 1994, 1995 Rogue Wave Software, Inc.
  14.  * ALL RIGHTS RESERVED *
  15.  * The software and information contained herein are proprietary to, and
  16.  * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
  17.  * intends to preserve as trade secrets such software and information.
  18.  * This software is furnished pursuant to a written license agreement and
  19.  * may be used, copied, transmitted, and stored only in accordance with
  20.  * the terms of such license and with the inclusion of the above copyright
  21.  * notice.  This software and information or any other copies thereof may
  22.  * not be provided or otherwise made available to any other person.
  23.  *
  24.  * Notwithstanding any other lease or license that may pertain to, or
  25.  * accompany the delivery of, this computer software and information, the
  26.  * rights of the Government regarding its use, reproduction and disclosure
  27.  * are as set forth in Section 52.227-19 of the FARS Computer
  28.  * Software-Restricted Rights clause.
  29.  * 
  30.  * Use, duplication, or disclosure by the Government is subject to
  31.  * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
  32.  * Technical Data and Computer Software clause at DFARS 252.227-7013.
  33.  * Contractor/Manufacturer is Rogue Wave Software, Inc.,
  34.  * P.O. Box 2328, Corvallis, Oregon 97339.
  35.  *
  36.  * This computer software and information is distributed with "restricted
  37.  * rights."  Use, duplication or disclosure is subject to restrictions as
  38.  * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
  39.  * Computer Software-Restricted Rights (April 1985)."  If the Clause at
  40.  * 18-52.227-74 "Rights in Data General" is specified in the contract,
  41.  * then the "Alternate III" clause applies.
  42.  *
  43.  **************************************************************************/
  44.  
  45. # include "stdcomp.h"    /* Set compiler-specific flags */
  46.  
  47. STARTWRAP
  48. #ifndef _RWSTD_NO_NEW_HEADER
  49. #include <cstddef>        /* Looking for size_t */
  50. #else
  51. #include <stddef.h>        /* Looking for size_t */
  52. #endif
  53. ENDWRAP
  54.  
  55.  
  56. #define rwstdnil    0
  57. #define    _RWSTDNIL    -1L
  58.  
  59. #ifndef _RWSTD_NO_NEW_HEADER
  60. #ifndef _RWSTD_NO_NAMESPACE
  61. using std::size_t;
  62. #endif
  63. #endif
  64.   
  65. /*
  66.  *     W I N D O W S - S P E C I F I C   C O D E
  67.  *
  68.  * Enable or disable, as necessary, for Microsoft Windows
  69.  */
  70. #if defined(__WIN32__) || defined (__WIN16__) 
  71. #  include "rw/stdwind.h"
  72. #else
  73.    /* Disable Windows hacks if we are not compiling for Windows: */
  74. #  define _RWSTDExport
  75. #  define _RWSTDExportTemplate
  76. #  define _RWSTDExportFunc(ReturnType) ReturnType
  77. #  define _RWSTDExportTemplate
  78. #  define rwexport
  79. #endif
  80.  
  81. #ifndef _MSC_VER
  82. #define _RWSTDGExport _RWSTDExport
  83. #else
  84. #define _RWSTDGExport
  85. #endif
  86.  
  87.  
  88. /*************************************************************************
  89. **************************************************************************
  90. **                                    **
  91. **        From here on, it's pretty much boilerplate        **
  92. **        and rarely requires any tuning.                **
  93. **                                    **
  94. **************************************************************************
  95. **************************************************************************/
  96.  
  97. /*
  98.  *     D E B U G G I N G
  99.  *
  100.  * Use -D_RWSTDDEBUG to compile a version of the libraries to debug
  101.  * the user's code.  This will perform pre- and post-condition checks
  102.  * upon entering routines, but will be larger and run more slowly.
  103.  *
  104.  * Use -D_RWMEMCK to add memory checking software.
  105.  *
  106.  * VERY IMPORTANT!  *All* code must be compiled with the same flag.
  107.  */
  108.  
  109. #if defined(RDEBUG) && !defined(_RWSTDDEBUG)
  110. #  define _RWSTDDEBUG 1
  111. #endif
  112.  
  113. #if defined(_RWSTDDEBUG)
  114. #  ifndef _RWSTDBOUNDS_CHECK
  115. #    define _RWSTDBOUNDS_CHECK 1    /* Turn on bounds checking when debugging. */
  116. #  endif
  117. STARTWRAP
  118. #ifndef _RWSTD_NO_NEW_HEADER
  119. #  include <cassert>
  120. #else
  121. #  include <assert.h>
  122. #endif
  123. ENDWRAP
  124. #  define _RWSTDPRECONDITION(a)    assert( (a) != 0 ) /* Check pre- and post-conditions */
  125. #  define _RWSTDPOSTCONDITION(a)    assert( (a) != 0 )
  126. #ifdef _RWSTD_NO_NESTED_QUOTES
  127. #  define _RWSTDPRECONDITION2(a,b)    assert( (a) != 0 )
  128. #  define _RWSTDPOSTCONDITION2(a,b)    assert( (a) != 0 )
  129. #else
  130. #  define _RWSTDPRECONDITION2(a,b)    assert((b, (a) !=0))
  131. #  define _RWSTDPOSTCONDITION2(a,b)    assert((b, (a) !=0))
  132. #endif
  133. #  define _RWSTDASSERT(a)        assert( (a) != 0 )
  134. #else
  135. #  define _RWSTDPRECONDITION(a)
  136. #  define _RWSTDPOSTCONDITION(a)
  137. #  define _RWSTDPRECONDITION2(a,b)
  138. #  define _RWSTDPOSTCONDITION2(a,b)
  139. #  define _RWSTDASSERT(a)
  140. #endif
  141.  
  142. /* Check for USL hook for multi-thread mode: */
  143. #if defined(_REENTRANT) && !defined(_RWSTD_MULTI_THREAD)
  144. # define _RWSTD_MULTI_THREAD 1
  145. #endif
  146.  
  147.  
  148.  
  149. /*
  150.  * The following allows getting the declaration for RTL classes
  151.  * right without having to include the appropriate header file
  152.  * (in particular, istream & ostream).
  153.  */
  154. #ifdef __TURBOC__
  155. #  include <_defs.h>    /* Looking for _CLASSTYPE */
  156. #  define _RWSTDCLASSTYPE _CLASSTYPE
  157. #else
  158. #  define _RWSTDCLASSTYPE
  159. #endif
  160.  
  161. /* No RCS for MS-DOS (it has enough memory problems already!): */
  162. #ifdef __MSDOS__
  163. #define RCSID(a)
  164. #define _RW_RCSID(a)
  165. #else
  166. #define RCSID(a) static const char rcsid[] = a
  167. #define _RWSTD_RCSID(a) static const char rcsid[] = a
  168. #endif
  169.  
  170. /* Enable near/far pointers if we are using segmented architecture: */
  171. #if (defined(__MSDOS__) || defined(I8086)) && !defined(__HIGHC__)
  172. #  define _RWSTD_SEGMENTED_ARCHITECTURE
  173. #  define rwnear near
  174. #  define rwfar  far
  175. #  define rwhuge huge
  176. #else
  177. #  define rwnear
  178. #  define rwfar
  179. #  define rwhuge
  180. #endif
  181.  
  182. #ifdef __cplusplus
  183.  
  184.  
  185. const size_t _RWSTD_NPOS            = ~(size_t)0;
  186.  
  187.  
  188. #ifndef _RW_STD_IOSTREAM
  189. class _RWSTDCLASSTYPE istream;
  190. class _RWSTDCLASSTYPE ostream;
  191. class _RWSTDCLASSTYPE ios;
  192. #endif
  193.  
  194. #ifdef _RW_MULTI_THREAD
  195. class _RWSTDMutex;
  196. #endif
  197.  
  198. #ifdef _RWSTD_NO_FRIEND_INLINE_DECL
  199. #  define _RWSTD_INLINE_FRIEND friend
  200. #else
  201. #  define _RWSTD_INLINE_FRIEND inline friend
  202. #endif
  203.  
  204.  
  205. #endif // if C++
  206.  
  207. #pragma option pop
  208. #endif // __RWSTDDEFS_H__
  209.  
  210.